<html>
<head><meta charset="utf-8"><title>possible bug in error_reporting · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/possible.20bug.20in.20error_reporting.html">possible bug in error_reporting</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="196836858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/possible%20bug%20in%20error_reporting/near/196836858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Russell Cohen <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/possible.20bug.20in.20error_reporting.html#196836858">(May 07 2020 at 22:11)</a>:</h4>
<p>I was working on an unrelated issue, which lead me to audit usages of <code>zip(other_iter).all(|(a,b)|a==b)</code> that don't first verify that the iterators are equal length. I found <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_trait_selection/traits/error_reporting/on_unimplemented.rs#L54-L59" title="https://github.com/rust-lang/rust/blob/master/src/librustc_trait_selection/traits/error_reporting/on_unimplemented.rs#L54-L59">https://github.com/rust-lang/rust/blob/master/src/librustc_trait_selection/traits/error_reporting/on_unimplemented.rs#L54-L59</a> which I'm pretty sure is a bug but I don't know for sure since I have basically no idea what any of the words mean <span aria-label="grimacing" class="emoji emoji-1f62c" role="img" title="grimacing">:grimacing:</span> (eg. maybe its intentional that trait_ref.substs can be a subset of impl_ref.substs)</p>



<a name="196838027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/possible%20bug%20in%20error_reporting/near/196838027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/possible.20bug.20in.20error_reporting.html#196838027">(May 07 2020 at 22:25)</a>:</h4>
<p>I am pretty sure it's not a bug, because <code>impl_trait_ref.substs</code> and <code>trait_ref.substs</code> are just different substitutions for the same trait and have the same length</p>



<a name="196838977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/possible%20bug%20in%20error_reporting/near/196838977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/possible.20bug.20in.20error_reporting.html#196838977">(May 07 2020 at 22:36)</a>:</h4>
<p>Indeed</p>



<a name="196839029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/possible%20bug%20in%20error_reporting/near/196839029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/possible.20bug.20in.20error_reporting.html#196839029">(May 07 2020 at 22:37)</a>:</h4>
<p>It's almost certainly the case that <code>for_each_relevant_impl</code> gives impls where the self type matches</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>